package com.docker.jy.service.impl;

import java.util.List;

import com.docker.chy.domain.DoctorPatient;
import com.docker.chy.mapper.DoctorPatientMapper;
import com.docker.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.docker.jy.mapper.DoctorVipMapper;
import com.docker.jy.domain.DoctorVip;
import com.docker.jy.service.IDoctorVipService;

/**
 * 会员列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class DoctorVipServiceImpl implements IDoctorVipService 
{
    @Autowired
    private DoctorVipMapper doctorVipMapper;
    @Autowired
    private DoctorPatientMapper doctorPatientMapper;

    /**
     * 查询会员列表
     * 
     * @param id 会员列表主键
     * @return 会员列表
     */
    @Override
    public DoctorVip selectDoctorVipById(Long id)
    {
        return doctorVipMapper.selectDoctorVipById(id);
    }

    /**
     * 查询会员列表列表
     * 
     * @param doctorVip 会员列表
     * @return 会员列表
     */
    @Override
    public List<DoctorVip> selectDoctorVipList(DoctorVip doctorVip)
    {
        return doctorVipMapper.selectDoctorVipList(doctorVip);
    }

    /**
     * 新增会员列表
     * 
     * @param doctorVip 会员列表
     * @return 结果
     */
    @Override
    public int insertDoctorVip(DoctorVip doctorVip)
    {
        doctorVip.setCreateTime(DateUtils.getNowDate());
        return doctorVipMapper.insertDoctorVip(doctorVip);
    }

    /**
     * 修改会员列表
     * 
     * @param doctorVip 会员列表
     * @return 结果
     */
    @Override
    public int updateDoctorVip(DoctorVip doctorVip)
    {
        return doctorVipMapper.updateDoctorVip(doctorVip);
    }

    /**
     * 批量删除会员列表
     * 
     * @param ids 需要删除的会员列表主键
     * @return 结果
     */
    @Override
    public int deleteDoctorVipByIds(Long[] ids)
    {
        return doctorVipMapper.deleteDoctorVipByIds(ids);
    }

    /**
     * 删除会员列表信息
     * 
     * @param id 会员列表主键
     * @return 结果
     */
    @Override
    public int deleteDoctorVipById(Long id)
    {
        return doctorVipMapper.deleteDoctorVipById(id);
    }
    //根据不同会员等级查询每个等级的每个患者的总金额,然后在前端通过一个饼图展示
//    @Override
//    public List<DoctorVip> selectDoctorVipByVipGrade() {
//        return doctorVipMapper.selectDoctorVipByVipGrade();
//    }
    @Override
    public List<DoctorVip> selectVipConsumptionGroupByGrade() {
        return doctorVipMapper.selectVipConsumptionGroupByGrade();
    }

}
